package com.example.test;

import java.util.concurrent.TimeUnit;

/**
 * TODO: 这里要写注释的!
 */
public class Participant implements Runnable {
    private String name;
    private VideoConference conference;
    public Participant(VideoConference conference,String name){
        this.conference= conference;
        this.name= name;
    }

    @Override public void run() {
        long duration= (long) (Math.random()*10);
        try {
            TimeUnit.SECONDS.sleep(duration);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        conference.arrive(name);

    }
}
